package com.black.play.component.base;

import com.black.play.common.FormComponent;

import javax.swing.*;

/**
 * @author ylx
 */
public class AppInput extends FormComponent<JTextField> {

    private int column = 20;

    public AppInput(String label) {
        super(label);
    }

    public AppInput(String label, String value) {
        super(label, value);
    }

    public AppInput(String label, String value, int column) {
        super(label, value);
        this.column = column;
    }

    @Override
    public void initComponent() {
        this.component = new JTextField(this.value, this.column);
    }

    @Override
    public String getValue() {
        return this.component.getText();
    }

    @Override
    public void setText() {
        this.component.setText(this.value);
    }
}
